import request from '../util/request'

//添加广告的ajax请求
export const addAdvRequest = (myForm)=>{//形参接收advList中路由传入的参数
    return request.post('/addAdv',myForm)
}
//查询所有广告
export const advListRequest =()=>{
    return request.get('/advList')
}
//删除广告
export const deleteAdvList = (_id) =>{
    return request.delete('/deleteAdv',{//axios实例第二个参数是一个配置对象，params是即将与请求一起发送的url参数
        params:{
            _id
        }
    })
}
//点击外层更新请求
export const getUpdateDataRequest =(_id)=>{
    return request.get('/getUpdateData',{
        params:{
            _id
        }
    })
}